package cn.bone.base.component;

import lombok.Data;
import org.mybatis.spring.annotation.MapperScan;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.PropertySource;
import org.springframework.stereotype.Component;

@Component
@ConfigurationProperties(prefix = "ou.param")
@PropertySource(value = {
        "classpath:env-${spring.profiles.active}/param-${spring.profiles.active}.properties"
})
@Data
public class GlobalParam {

    private JwtParam jwt;
    private AliossParam alioss;
    private SuperMemberParam superMember;

    @Data
    public static class JwtParam{
        private String password;        //jwt加密的密码
        private Integer expireValid;    //是否校验超时(0:否,1:是)
        private Long expireTime;        //过期时间毫米数
    }

    @Data
    public static class AliossParam{
        private String accessKey;
        private String secretKey;
        private String endpoint;
        private String bucketName;
        private String imgBucket;
        private String fileBucket;
        private String imgType0;
        private String imgType1;
        private String imgType2;
    }

    @Data
    public static class SuperMemberParam{
        private String username;
        private String password;
    }
}